TOP = $(shell pwd)
INC := -I$(TOP)/include
SRC = $(wildcard $(TOP)/src/*c)
OBJ =$(patsubst %.c,%.o,$(SRC))
CFLAGE =  -std=gnu11 -Wall -Werror -fPIC -g -lpthread
ASAN_FLAG := -fsanitize=address -fsanitize=leak -fsanitize=undefined #-fsanitize=thread
CFLAGE += $(ASAN_FLAG)

all:thrd
	@echo "thrdpool!!!"

thrd:$(OBJ) main.c
	gcc -o $@ $^ $(CFLAGE) $(INC)

%.o : %.c
	echo "  CC  $<"
	gcc -o $@ -c $< $(CFLAGE) $(INC)
	
.PHONY:clean
clean:
	rm -rf *.o src/*o thrd